From 42dfa0484b1c14a4dfb91f26d9abf07ea6446dbc Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Sun, 26 Nov 2017 23:47:25 -0600 Subject: [PATCH] Move is_html (and a fwe in-methods that I could find) from int to bool. --- bushnell_trl.cc | 2 +- garmin_gpi.cc | 2 +- googledir.cc | 2 +- gpx.cc | 6 +++--- igc.cc | 2 +- itracku.cc | 2 +- main.cc | 4 ++-- mmo.cc | 2 +- mtk_logger.cc | 2 +- osm.cc | 2 +- queue.cc | 2 +- teletype.cc | 4 ++-- tpo.cc | 2 +- util.cc | 2 +- v900.cc | 2 +- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bushnell_trl.cc b/bushnell_trl.cc index cb32441af..59a38e760 100644 --- a/bushnell_trl.cc +++ b/bushnell_trl.cc @@ -98,7 +98,7 @@ bushnell_read() { int lat_tmp,lon_tmp; - while (1) { + while (true) { Waypoint* wpt_tmp; lat_tmp = gbfgetint32(file_in); diff --git a/garmin_gpi.cc b/garmin_gpi.cc index 7d7db040b..8c96c7a73 100644 --- a/garmin_gpi.cc +++ b/garmin_gpi.cc @@ -1562,7 +1562,7 @@ garmin_gpi_wr_deinit() static void garmin_gpi_read() { - while (1) { + while (true) { int tag = gbfgetint32(fin); if (tag == 0xffff) { return; diff --git a/googledir.cc b/googledir.cc index e96f7cacf..c477802de 100644 --- a/googledir.cc +++ b/googledir.cc @@ -104,7 +104,7 @@ goog_poly_e(xg_string args, const QXmlStreamAttributes*) routehead->rte_desc = QString("Step %1").arg(goog_step); } else { utf_string utf; - utf.is_html = 1; + utf.is_html = true; utf.utfstring = instructions; char *s = strip_html(&utf); routehead->rte_desc = s; diff --git a/gpx.cc b/gpx.cc index 62500ec98..b067915c2 100644 --- a/gpx.cc +++ b/gpx.cc @@ -56,7 +56,7 @@ static QString current_tag; static Waypoint* wpt_tmp; static UrlLink* link_; -static int cache_descr_is_html; +static bool cache_descr_is_html; static gpsbabel::File* iqfile; static gpsbabel::File* oqfile; static gpsbabel::XmlStreamWriter* writer; @@ -494,10 +494,10 @@ tag_wpt(const QXmlStreamAttributes& attr) static void tag_cache_desc(const QXmlStreamAttributes& attr) { - cache_descr_is_html = 0; + cache_descr_is_html = false; if (attr.hasAttribute("html")) { if (attr.value("html").toString() == QStringLiteral("True")) { - cache_descr_is_html = 1; + cache_descr_is_html = true; } } } diff --git a/igc.cc b/igc.cc index 7cf6fc787..eb30dbde0 100644 --- a/igc.cc +++ b/igc.cc @@ -281,7 +281,7 @@ static void data_read() strcpy(trk_desc, HDRMAGIC HDRDELIM); - while (1) { + while (true) { rec_type = get_record(&ibuf); switch (rec_type) { case rec_manuf_id: diff --git a/itracku.cc b/itracku.cc index e4ff18498..ec6769c2b 100644 --- a/itracku.cc +++ b/itracku.cc @@ -747,7 +747,7 @@ itracku_rt_position(posn_status*) { char line[1024]; Waypoint* wpt; - while (1) { + while (true) { gbser_read_line(fd, line, sizeof(line), 5000, 13, 10); dbg(1, line); wpt = gprmc_parse(line); diff --git a/main.cc b/main.cc index f57fb0ea2..0f51286b4 100644 --- a/main.cc +++ b/main.cc @@ -33,7 +33,7 @@ #include #include #include -#include +#include #define MYNAME "main" @@ -228,7 +228,7 @@ main(int argc, char* argv[]) char* ofname = NULL; const char* ivec_opts = NULL; const char* ovec_opts = NULL; - char* fvec_opts = NULL; + const char* fvec_opts = NULL; int opt_version = 0; int did_something = 0; const char* prog_name = argv[0]; /* argv is modified during processing */ diff --git a/mmo.cc b/mmo.cc index 542b83c65..9b3ae4f9c 100644 --- a/mmo.cc +++ b/mmo.cc @@ -1294,7 +1294,7 @@ mmo_write_wpt_cb(const Waypoint* wpt) utf_string tmp; tmp.utfstring = cx; - tmp.is_html = 1; + tmp.is_html = true; cx = kml = strip_html(&tmp); } str += cx; diff --git a/mtk_logger.cc b/mtk_logger.cc index 15ea67ba6..d4b3d4abd 100644 --- a/mtk_logger.cc +++ b/mtk_logger.cc @@ -588,7 +588,7 @@ static void mtk_read() } gb_sleep(10*1000); - if (1 || log_enabled) { + if (true || log_enabled) { i = do_cmd(CMD_LOG_DISABLE, "PMTK001,182,5,3", NULL, 2); dbg(3, " ---- LOG DISABLE ---- %s\n", i==0?"Success":"Fail"); } diff --git a/osm.cc b/osm.cc index 25775a2c3..3caf66ec5 100644 --- a/osm.cc +++ b/osm.cc @@ -460,7 +460,7 @@ static char* osm_strip_html(const char* str) { utf_string utf; - utf.is_html = 1; + utf.is_html = true; utf.utfstring = (char*)str; return strip_html(&utf); // util.cc diff --git a/queue.cc b/queue.cc index bba69cd14..e5f40494e 100644 --- a/queue.cc +++ b/queue.cc @@ -113,7 +113,7 @@ sortqueue(queue* qh, int (*cmp)(const queue*, const queue*)) insize = 1; - while (1) { + while (true) { p = list; oldhead = list; /* only used for circular linkage */ list = NULL; diff --git a/teletype.cc b/teletype.cc index c9db7dc69..f789981ed 100644 --- a/teletype.cc +++ b/teletype.cc @@ -63,14 +63,14 @@ teletype_read() wpt->shortname = (gbfgetcstr(fin)); wpt->description = (gbfgetcstr(fin)); - if (1) { // needs bit values of NEWFORMAT2 + if (true) { // needs bit values of NEWFORMAT2 uint32_t direction = gbfgetuint32(fin); uint32_t mins = gbfgetuint32(fin); (void) direction ; (void) mins ; } - if (1) { // need bit value of NEWFORMAT + if (true) { // need bit value of NEWFORMAT int len = gbfgetuint16(fin); // probably could treat as a pascal string char* junk = (char*) xmalloc(len); diff --git a/tpo.cc b/tpo.cc index 83edc77d1..d8dbddc66 100644 --- a/tpo.cc +++ b/tpo.cc @@ -215,7 +215,7 @@ tpo_read_until_section(const char* section_name, int seek_bytes) unsigned int match_index = 0; int header_size = 0; - while (1) { + while (true) { if (gbfread(&byte, 1, 1, tpo_file_in) < 1) { fatal(MYNAME ": malformed input file - attempt to read past end"); } diff --git a/util.cc b/util.cc index 67a300ae0..fd96cdf47 100644 --- a/util.cc +++ b/util.cc @@ -1613,7 +1613,7 @@ entity_types stdentities[] = { static char* -entitize(const char* str, int is_html) +entitize(const char* str, bool is_html) { int elen, ecount, nsecount; entity_types* ep; diff --git a/v900.cc b/v900.cc index b66338cb0..1cecd9c17 100644 --- a/v900.cc +++ b/v900.cc @@ -236,7 +236,7 @@ v900_read() track->rte_desc = "V900 GPS tracklog data"; track_add_head(track); - while (1) { + while (true) { Waypoint* wpt; char c; int bad = 0; -- 2.30.2